using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class pages_CustomTourList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["mode"] == "det")
        {
            FacilityDAO daoFac=new FacilityDAO();
            pnlDetails.Visible = true;
            pnlMain.Visible = false;
            int fLocId = 0,sLocId=0;
            if (Request["f_loc"] != null) fLocId = int.Parse(Request["f_loc"]);
            if (Request["s_loc"] != null) sLocId = int.Parse(Request["s_loc"]);
            dgrFacility.DataSource = daoFac.GetFacilitiesByLocation(fLocId, sLocId);
            dgrFacility.DataBind();
        }
        else
        {
            pnlDetails.Visible = false;
            pnlMain.Visible = true;
            LoadData();
        }
    }
    public void LoadData()
    {
        LocationDAO daoLocation = new LocationDAO();       
        cmbDepLoc.DataSource = daoLocation.GetAllLocations();
        cmbDepLoc.DataTextField = "Name";
        cmbDepLoc.DataValueField = "Id";
        cmbArvLoc.DataSource = daoLocation.GetAllLocations();
        cmbArvLoc.DataTextField = "Name";
        cmbArvLoc.DataValueField = "Id";      
        cmbDepLoc.DataBind();
        cmbArvLoc.DataBind();
            
    }
    public string GetDepLoc()
    {
        if (Request["f_loc"] != null) return Request["f_loc"];
        return "";
    }
    public string GetArvLoc()
    {
        if (Request["s_loc"] != null) return Request["s_loc"];
        return "";
    }
}
